vulkan: Enable alpha blending
authorBenjamin Otte <otte@redhat.com>
Fri, 9 Dec 2016 04:51:51 +0000 (05:51 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 9 Dec 2016 17:35:52 +0000 (18:35 +0100)
We will need that once we actually composite stuff.

gsk/gskvulkanpipeline.c
gsk/gskvulkanrender.c

index 25e81f5cef57c313e92a78cfcddf1c7263ad336c..a0b43fdc9dc4ed2ae378ca38e29bb0fc8f0128cf 100644 (file)
@@ -178,10 +178,19 @@ gsk_vulkan_pipeline_new (GdkVulkanContext *context,
                                                    .sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
                                                    .attachmentCount = 1,
                                                    .pAttachments = (VkPipelineColorBlendAttachmentState []) {
-                                                       { .colorWriteMask = VK_COLOR_COMPONENT_A_BIT |
-                                                                           VK_COLOR_COMPONENT_R_BIT |
-                                                                           VK_COLOR_COMPONENT_G_BIT |
-                                                                           VK_COLOR_COMPONENT_B_BIT },
+                                                       {
+                                                           .blendEnable = VK_TRUE,
+                                                           .colorBlendOp = VK_BLEND_OP_ADD,
+                                                           .srcColorBlendFactor = VK_BLEND_FACTOR_ONE,
+                                                           .dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,
+                                                           .alphaBlendOp = VK_BLEND_OP_ADD,
+                                                           .srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE,
+                                                           .dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,
+                                                           .colorWriteMask = VK_COLOR_COMPONENT_A_BIT
+                                                                           | VK_COLOR_COMPONENT_R_BIT
+                                                                           | VK_COLOR_COMPONENT_G_BIT
+                                                                           | VK_COLOR_COMPONENT_B_BIT
+                                                       },
                                                    }
                                                },
                                                .pDynamicState = &(VkPipelineDynamicStateCreateInfo) {
index 68f43ad7d1943e3bfb71b408097c51b157d723bd..626f6389cccde90652316da768618e584ccfd06d 100644 (file)
@@ -127,7 +127,7 @@ gsk_vulkan_render_new (GskRenderer      *renderer,
                                            {
                                               .format = gdk_vulkan_context_get_image_format (self->vulkan),
                                               .samples = VK_SAMPLE_COUNT_1_BIT,
-                                              .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD,
+                                              .loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
                                               .storeOp = VK_ATTACHMENT_STORE_OP_STORE,
                                               .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
                                               .finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,